﻿// 监听来自background.js和popup.js的消息

chrome.runtime.onMessage.addListener(function (request, sender, sendRequest) {
    var type = request.type;
    if (type == 'parseSellerId') {
        var script = $('script#spaui-state');
        console.log(script[0].innerText);
        var text = JSON.parse(script[0].innerText);
        chrome.runtime.sendMessage({
            type: 'getMerProfile',
            data: text
        })
    }
});